﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CRM.Admin.Contracts.Dto.Customer;
using CRM.Admin.Contracts.Model.Customer;
using KingsSharp.Common.Data;
using KingsSharp.Core;

namespace CRM.Admin.Contracts.Contract.Customer
{
    public interface IProductService:IDependency
    {
        /// <summary>
        /// 顾客产品明细集合
        /// </summary>
        IQueryable<Product> Products { get; }

        /// <summary>
        /// 顾客零件明细集合
        /// </summary>
        IQueryable<Component> Components { get; }

        /// <summary>
        /// 新增产品
        /// </summary>
        /// <param name="dtos">产品信息dto</param>
        /// <returns></returns>
        OperationResult Insert(params ProductDto[] dtos);

        /// <summary>
        /// 新增零件
        /// </summary>
        /// <param name="dtos">产品信息dto</param>
        /// <returns></returns>
        OperationResult Insert(params ComponentDto[] dtos);
        /// <summary>
        /// 删除零件
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        OperationResult Delete(params Guid[] ids);


        /// <summary>
        /// 编辑顾客产品明细
        /// </summary>
        /// <param name="dtos">顾客产品明细信息dto</param>
        /// <returns></returns>
        OperationResult Update(params ProductDto[] dtos);

        /// <summary>
        /// 编辑顾客零件明细
        /// </summary>
        /// <param name="dtos">顾客产品明细信息dto</param>
        /// <returns></returns>
        OperationResult Update(params ComponentDto[] dtos);

        /// <summary>
        /// 删除顾客产品
        /// </summary>
        /// <param name="isProduct">是否删除产品</param>
        /// <param name="ids">要删除的主键数组</param>
        /// <returns></returns>
        OperationResult Delete(bool isProduct,params Guid[] ids);
    }
}
